package com.unionwo.commons.base;

import java.util.List;

import com.unionwo.commons.exception.DaoException;


public interface BaseDao<T,PK> {
	// -- CRUD for all objects
	public  T get(PK id) throws DaoException;
	public  T getByName(String name) throws DaoException;
	public  List<T> getAll() throws DaoException;
	public  int create(T entity) throws DaoException;
	int update(T entity) throws DaoException;
	int delete(T entity) throws DaoException;
	
	// -- pagination
	//public Page getAllByPage(String statement,  int pageSize,  int pageNum);
	public List<T> getAllByPage(int pageSize,  int pageNum); 
	
	
}
